package cn.edu.bit.ss.util;
import java.util.LinkedList;
public class LinkedListQueue<T> implements Queue<T>{

	
	private LinkedList<T> queue = new LinkedList<T>();	
	private int volume;
	
	public LinkedListQueue(int volume){
		this.volume = volume;
	}
	
	@Override
	public void add(T t) {//Must call isFull() Function before!!!!!!
		queue.add(t);		
	}

	@Override
	public T getNext() {	//isEmplty() Function before is Recommended
		return queue.remove();		
	}

	@Override
	public int getSize() {
		return queue.size();
	}

	@Override
	public boolean isEmpty() {
		return queue.isEmpty();
	}

	@Override
	public boolean isFull() {
		return queue.size()>=volume;
	}

}
